Get premium membership and access questions with answers, video lessons as well as revision papers.

What will be the output of following program ? 1 2 3 4 5 6 7 8 9 10 11 12 #include < stdio.h > int main() { int tally=0; for(;;) ...

      

What will be the output of following program ?
1
2
3
4
5
6
7
8
9
10
11
12
#include < stdio.h >
int main()
{
int tally=0;
for(;;)
{
if(tally==10)
break;
printf("%d ",++tally);
}
return 0;
}
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 ... infinite times
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9

  

Answers


kinyua
Correct Answer - 3
1 2 3 4 5 6 7 8 9 10
for(; ;) it is possible in c, there is no need to place condition with in the for(), you can place condition with in the body of the loop.
monica20 answered the question on February 24, 2018 at 16:56


Next: What will be the output of following program ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include void main() { int i=1; while (i<=5) { ...
Previous: Explain five benefits that would accrue to a businessman who uses a Liner rather than Tramps Steamers

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions